import { RouteRecordRaw } from 'vue-router'
import Layout from '@/Layout/index.vue'

const LoginRoute: RouteRecordRaw = {
  path: '/login',
  name: 'Login',
  component: () => import('@/views/login/index.vue')
}

const HomeRoute: RouteRecordRaw = {
  path: '/',
  name: 'Home',
  redirect: '/dashboard'
}

const AsyncRoute: RouteRecordRaw = {
  path: '/dashboard',
  component: Layout,
  redirect: '/dashboard',
  children: [
    {
      path: '',
      component: () => import('@/views/AboutView.vue'),
      name: 'Dashboard',
      meta: {
        noCache: false,
        title: '首页'
      }
    },
    {
      path: 'home',
      component: () => import('@/views/HomeView.vue')
    }
  ]
}

export default [
  LoginRoute,
  HomeRoute,
  AsyncRoute
]
